/**
 *
 */
import OpenApi;
import OpenApi.OpenApiUtil;

extends OpenApi;


init(config: OpenApiUtil.Config){
  super(config);
  @endpointRule = 'regional';
  @endpointMap = {
    'cn-hangzhou' = 'market.aliyuncs.com',
    'ap-northeast-1' = 'market.ap-southeast-1.aliyuncs.com',
    'ap-south-1' = 'market.ap-southeast-1.aliyuncs.com',
    'ap-southeast-2' = 'market.ap-southeast-1.aliyuncs.com',
    'ap-southeast-3' = 'market.ap-southeast-1.aliyuncs.com',
    'ap-southeast-5' = 'market.ap-southeast-1.aliyuncs.com',
    'cn-beijing' = 'market.aliyuncs.com',
    'cn-chengdu' = 'market.aliyuncs.com',
    'cn-hongkong' = 'market.aliyuncs.com',
    'cn-huhehaote' = 'market.aliyuncs.com',
    'cn-qingdao' = 'market.aliyuncs.com',
    'cn-shanghai' = 'market.aliyuncs.com',
    'cn-shenzhen' = 'market.aliyuncs.com',
    'cn-zhangjiakou' = 'market.aliyuncs.com',
    'eu-central-1' = 'market.ap-southeast-1.aliyuncs.com',
    'eu-west-1' = 'market.ap-southeast-1.aliyuncs.com',
    'me-east-1' = 'market.ap-southeast-1.aliyuncs.com',
    'us-east-1' = 'market.ap-southeast-1.aliyuncs.com',
    'us-west-1' = 'market.ap-southeast-1.aliyuncs.com',
    'cn-hangzhou-finance' = 'market.aliyuncs.com',
    'cn-shenzhen-finance-1' = 'market.aliyuncs.com',
    'cn-shanghai-finance-1' = 'market.aliyuncs.com',
    'cn-north-2-gov-1' = 'market.aliyuncs.com',
  };

  checkConfig(config);
  @endpoint = getEndpoint('market', @regionId, @endpointRule, @network, @suffix, @endpointMap, @endpoint);
}

function getEndpoint(productId: string, regionId: string, endpointRule: string, network: string, suffix: string, endpointMap: map[string]string, endpoint: string) throws: string{
  if (!$isNull(endpoint)) {
    return endpoint;
  }
  
  if (!$isNull(endpointMap) && !$isNull(endpointMap[regionId])) {
    return endpointMap[regionId];
  }
  return OpenApiUtil.getEndpointRules(productId, regionId, endpointRule, network, suffix);
}

model ActivateLicenseRequest {
  identification?: string(name='Identification', example='129****1111'),
  licenseCode?: string(name='LicenseCode', description='This parameter is required.', example='APSEDH8TA5CSGK-********_6CNTACBH9EQPOATFXJQL4B2COE7M43VVQ7GUGKAA'),
}

model ActivateLicenseResponseBody = {
  requestId?: string(name='RequestId', example='6EF60BEC-0242-43AF-BB20-270359FB54A7'),
  success?: boolean(name='Success', example='true'),
}

model ActivateLicenseResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ActivateLicenseResponseBody(name='body'),
}

/**
 * @summary 增加STS支持
 *
 * @param request ActivateLicenseRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ActivateLicenseResponse
 */
async function activateLicenseWithOptions(request: ActivateLicenseRequest, runtime: $RuntimeOptions): ActivateLicenseResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.identification)) {
    query['Identification'] = request.identification;
  }
  if (!$isNull(request.licenseCode)) {
    query['LicenseCode'] = request.licenseCode;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ActivateLicense',
    version = '2015-11-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 增加STS支持
 *
 * @param request ActivateLicenseRequest
 * @return ActivateLicenseResponse
 */
async function activateLicense(request: ActivateLicenseRequest): ActivateLicenseResponse {
  var runtime = new $RuntimeOptions{};
  return activateLicenseWithOptions(request, runtime);
}

model AutoRenewInstanceRequest {
  autoRenewCycle?: string(name='AutoRenewCycle'),
  autoRenewDuration?: int32(name='AutoRenewDuration'),
  orderBizId?: long(name='OrderBizId', description='This parameter is required.'),
  ownerId?: long(name='OwnerId'),
  type?: string(name='Type', description='This parameter is required.'),
}

model AutoRenewInstanceResponseBody = {
  data?: boolean(name='Data'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model AutoRenewInstanceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: AutoRenewInstanceResponseBody(name='body'),
}

/**
 * @param request AutoRenewInstanceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return AutoRenewInstanceResponse
 */
async function autoRenewInstanceWithOptions(request: AutoRenewInstanceRequest, runtime: $RuntimeOptions): AutoRenewInstanceResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.autoRenewCycle)) {
    body['AutoRenewCycle'] = request.autoRenewCycle;
  }
  if (!$isNull(request.autoRenewDuration)) {
    body['AutoRenewDuration'] = request.autoRenewDuration;
  }
  if (!$isNull(request.orderBizId)) {
    body['OrderBizId'] = request.orderBizId;
  }
  if (!$isNull(request.ownerId)) {
    body['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.type)) {
    body['Type'] = request.type;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'AutoRenewInstance',
    version = '2015-11-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request AutoRenewInstanceRequest
 * @return AutoRenewInstanceResponse
 */
async function autoRenewInstance(request: AutoRenewInstanceRequest): AutoRenewInstanceResponse {
  var runtime = new $RuntimeOptions{};
  return autoRenewInstanceWithOptions(request, runtime);
}

model CreateOrderRequest {
  clientToken?: string(name='ClientToken', description='This parameter is required.', example='2709c68a-d569-4819-9c5d-1222ed2ee924'),
  commodity?: string(name='Commodity', description='This parameter is required.'),
  orderSouce?: string(name='OrderSouce', example='abc'),
  orderType?: string(name='OrderType', description='This parameter is required.', example='INSTANCE_BUY'),
  ownerId?: string(name='OwnerId', example='111********11'),
  paymentType?: string(name='PaymentType', description='This parameter is required.', example='HAND'),
}

model CreateOrderResponseBody = {
  instanceIds?: {
    instanceId?: [ string ](name='InstanceId')
  }(name='InstanceIds'),
  orderId?: string(name='OrderId', example='202********0117'),
  requestId?: string(name='RequestId', example='4ca591b5-bc30-4fa7-aeaa-c4d0ec5d24ed'),
}

model CreateOrderResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateOrderResponseBody(name='body'),
}

/**
 * @param request CreateOrderRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateOrderResponse
 */
async function createOrderWithOptions(request: CreateOrderRequest, runtime: $RuntimeOptions): CreateOrderResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!$isNull(request.commodity)) {
    query['Commodity'] = request.commodity;
  }
  if (!$isNull(request.orderSouce)) {
    query['OrderSouce'] = request.orderSouce;
  }
  if (!$isNull(request.orderType)) {
    query['OrderType'] = request.orderType;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.paymentType)) {
    query['PaymentType'] = request.paymentType;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'CreateOrder',
    version = '2015-11-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request CreateOrderRequest
 * @return CreateOrderResponse
 */
async function createOrder(request: CreateOrderRequest): CreateOrderResponse {
  var runtime = new $RuntimeOptions{};
  return createOrderWithOptions(request, runtime);
}

model CrossAccountVerifyTokenRequest {
  token?: string(name='Token', example='C19D103FEA2D50A584410267CE9FBA56'),
}

model CrossAccountVerifyTokenResponseBody = {
  code?: string(name='Code', example='200'),
  message?: string(name='Message', example='successful'),
  requestId?: string(name='RequestId', description='RequestId', example='C19D103F-EA2D-50A5-8441-0267CE9FBA56'),
  result?: {
    authRoles?: [ string ](name='AuthRoles'),
    authTime?: long(name='AuthTime', example='1676974108866'),
    name?: string(name='Name', example='marketplace_wangxiao_test'),
    uid?: string(name='Uid', example='1744526877246715'),
  }(name='Result'),
  success?: boolean(name='Success', example='true'),
}

model CrossAccountVerifyTokenResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CrossAccountVerifyTokenResponseBody(name='body'),
}

/**
 * @param request CrossAccountVerifyTokenRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CrossAccountVerifyTokenResponse
 */
async function crossAccountVerifyTokenWithOptions(request: CrossAccountVerifyTokenRequest, runtime: $RuntimeOptions): CrossAccountVerifyTokenResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.token)) {
    body['Token'] = request.token;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'CrossAccountVerifyToken',
    version = '2015-11-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request CrossAccountVerifyTokenRequest
 * @return CrossAccountVerifyTokenResponse
 */
async function crossAccountVerifyToken(request: CrossAccountVerifyTokenRequest): CrossAccountVerifyTokenResponse {
  var runtime = new $RuntimeOptions{};
  return crossAccountVerifyTokenWithOptions(request, runtime);
}

model DescribeApiMeteringRequest {
  pageNum?: int32(name='pageNum', description='This parameter is required.', example='1'),
  productCode?: string(name='productCode', example='cmapi0004****'),
  type?: int32(name='type', example='1'),
}

model DescribeApiMeteringResponseBody = {
  code?: string(name='Code', example='200'),
  count?: long(name='Count', example='100'),
  fatal?: boolean(name='Fatal', description='fatal', example='false'),
  message?: string(name='Message'),
  pageNumber?: long(name='PageNumber', example='1'),
  pageSize?: long(name='PageSize', example='20'),
  requestId?: string(name='RequestId', example='62FC432C55A1A63534A6CB34'),
  result?: [ 
    {
      aliyunPk?: long(name='AliyunPk', example='102277855749****'),
      productCode?: string(name='ProductCode', example='cmapi0004****'),
      productName?: string(name='ProductName'),
      totalCapacity?: long(name='TotalCapacity'),
      totalQuota?: long(name='TotalQuota', example='98'),
      totalUsage?: long(name='TotalUsage', example='220'),
      unit?: string(name='Unit'),
    }
  ](name='Result'),
  success?: boolean(name='Success', example='true'),
  version?: string(name='Version', example='1.0'),
}

model DescribeApiMeteringResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeApiMeteringResponseBody(name='body'),
}

/**
 * @summary 查询API用量
 *
 * @param request DescribeApiMeteringRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeApiMeteringResponse
 */
async function describeApiMeteringWithOptions(request: DescribeApiMeteringRequest, runtime: $RuntimeOptions): DescribeApiMeteringResponse {
  request.validate();
  var query = OpenApiUtil.query(request.toMap());
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeApiMetering',
    version = '2015-11-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 查询API用量
 *
 * @param request DescribeApiMeteringRequest
 * @return DescribeApiMeteringResponse
 */
async function describeApiMetering(request: DescribeApiMeteringRequest): DescribeApiMeteringResponse {
  var runtime = new $RuntimeOptions{};
  return describeApiMeteringWithOptions(request, runtime);
}

model DescribeCurrentNodeInfoRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='4****89'),
}

model DescribeCurrentNodeInfoResponseBody = {
  requestId?: string(name='RequestId', example='00eb4de1-6cff-4f56-833e-7b1e070e398d'),
  result?: {
    allowRollbackNode?: boolean(name='AllowRollbackNode', example='false'),
    autoFinishNode?: boolean(name='AutoFinishNode', example='false'),
    finalStepNo?: int32(name='FinalStepNo', example='4'),
    gmtExpired?: long(name='GmtExpired', example='1588920725000'),
    gmtFinished?: long(name='GmtFinished', example='1588920725000'),
    gmtStart?: long(name='GmtStart', example='1588834325000'),
    needAttachment?: boolean(name='NeedAttachment', example='false'),
    nextNodeId?: long(name='NextNodeId', example='8473'),
    nodeId?: long(name='NodeId', example='8472'),
    nodeName?: string(name='NodeName'),
    nodeStatus?: string(name='NodeStatus', example='Starting'),
    operatorRole?: string(name='OperatorRole', example='Provider'),
    parentNodeId?: long(name='ParentNodeId', example='0'),
    previousNodeId?: long(name='PreviousNodeId', example='8471'),
    stepNo?: int32(name='StepNo', example='3'),
    templateForm?: string(name='TemplateForm'),
  }(name='Result'),
  success?: boolean(name='Success', example='true'),
}

model DescribeCurrentNodeInfoResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeCurrentNodeInfoResponseBody(name='body'),
}

/**
 * @param request DescribeCurrentNodeInfoRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeCurrentNodeInfoResponse
 */
async function describeCurrentNodeInfoWithOptions(request: DescribeCurrentNodeInfoRequest, runtime: $RuntimeOptions): DescribeCurrentNodeInfoResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeCurrentNodeInfo',
    version = '2015-11-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request DescribeCurrentNodeInfoRequest
 * @return DescribeCurrentNodeInfoResponse
 */
async function describeCurrentNodeInfo(request: DescribeCurrentNodeInfoRequest): DescribeCurrentNodeInfoResponse {
  var runtime = new $RuntimeOptions{};
  return describeCurrentNodeInfoWithOptions(request, runtime);
}

model DescribeDistributionProductsRequest {
  filter?: [ 
    {
      key?: string(name='Key', description='This parameter is required.', example='supplierName'),
      value?: string(name='Value', description='This parameter is required.', example='cmj0000000'),
    }
  ](name='Filter'),
  pageNumber?: long(name='PageNumber', description='This parameter is required.', example='1'),
  pageSize?: long(name='PageSize', description='This parameter is required.', example='10'),
}

model DescribeDistributionProductsResponseBody = {
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  requestId?: string(name='RequestId', example='5BD09171-MB74-18D8-890E-C70C067527BE'),
  results?: [ 
    {
      code?: string(name='Code', example='cmap*****'),
      firstCategoryName?: string(name='FirstCategoryName'),
      imageUrl?: string(name='ImageUrl', example='//photogallery.oss-cn-hangzhou.aliyuncs.com/photo/1744526877246715/09605255-87fd-44d1-8143-96ebc8019d46.jpeg'),
      name?: string(name='Name'),
      price?: string(name='Price', example='100'),
      score?: string(name='Score', example='5'),
      secondCategoryName?: string(name='SecondCategoryName'),
      shortDescription?: string(name='ShortDescription'),
      submissionRadio?: string(name='SubmissionRadio', example='30'),
      supplierName?: string(name='SupplierName'),
      supplierUId?: string(name='SupplierUId', example='1911534921******'),
      tradeCount?: string(name='TradeCount', example='109'),
      type?: string(name='Type'),
      userCommentCount?: string(name='UserCommentCount', example='55'),
    }
  ](name='Results'),
  totalCount?: int32(name='TotalCount', example='50'),
}

model DescribeDistributionProductsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeDistributionProductsResponseBody(name='body'),
}

/**
 * @summary 分页获取推广商品
 *
 * @param request DescribeDistributionProductsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeDistributionProductsResponse
 */
async function describeDistributionProductsWithOptions(request: DescribeDistributionProductsRequest, runtime: $RuntimeOptions): DescribeDistributionProductsResponse {
  request.validate();
  var query = OpenApiUtil.query(request.toMap());
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeDistributionProducts',
    version = '2015-11-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 分页获取推广商品
 *
 * @param request DescribeDistributionProductsRequest
 * @return DescribeDistributionProductsResponse
 */
async function describeDistributionProducts(request: DescribeDistributionProductsRequest): DescribeDistributionProductsResponse {
  var runtime = new $RuntimeOptions{};
  return describeDistributionProductsWithOptions(request, runtime);
}

model DescribeDistributionProductsLinkRequest {
  codes?: [ string ](name='Codes', description='This parameter is required.'),
}

model DescribeDistributionProductsLinkShrinkRequest {
  codesShrink?: string(name='Codes', description='This parameter is required.'),
}

model DescribeDistributionProductsLinkResponseBody = {
  requestId?: string(name='RequestId', description='Id of the request', example='5BD09171-BF4D-18D8-890E-C70C067527BE'),
  result?: [ 
    {
      code?: string(name='Code'),
      name?: string(name='Name'),
      url?: string(name='Url'),
    }
  ](name='Result'),
  success?: boolean(name='Success', example='true'),
  totalCount?: long(name='TotalCount', example='50'),
}

model DescribeDistributionProductsLinkResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeDistributionProductsLinkResponseBody(name='body'),
}

/**
 * @summary 获取并生成推广商品-链接
 *
 * @param tmpReq DescribeDistributionProductsLinkRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeDistributionProductsLinkResponse
 */
async function describeDistributionProductsLinkWithOptions(tmpReq: DescribeDistributionProductsLinkRequest, runtime: $RuntimeOptions): DescribeDistributionProductsLinkResponse {
  tmpReq.validate();
  var request = new DescribeDistributionProductsLinkShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!$isNull(tmpReq.codes)) {
    request.codesShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.codes, 'Codes', 'json');
  }
  var query = {};
  if (!$isNull(request.codesShrink)) {
    query['Codes'] = request.codesShrink;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeDistributionProductsLink',
    version = '2015-11-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取并生成推广商品-链接
 *
 * @param request DescribeDistributionProductsLinkRequest
 * @return DescribeDistributionProductsLinkResponse
 */
async function describeDistributionProductsLink(request: DescribeDistributionProductsLinkRequest): DescribeDistributionProductsLinkResponse {
  var runtime = new $RuntimeOptions{};
  return describeDistributionProductsLinkWithOptions(request, runtime);
}

model DescribeImageInstanceForIsvRequest {
  customerPk?: long(name='CustomerPk'),
  ecsInstanceId?: string(name='EcsInstanceId'),
}

model DescribeImageInstanceForIsvResponseBody = {
  activeAddress?: string(name='ActiveAddress'),
  appJson?: string(name='AppJson'),
  autoRenewal?: string(name='AutoRenewal'),
  beganOn?: long(name='BeganOn'),
  componentJson?: string(name='ComponentJson'),
  constraints?: string(name='Constraints'),
  createdOn?: long(name='CreatedOn'),
  endOn?: long(name='EndOn'),
  extendJson?: string(name='ExtendJson'),
  hostJson?: string(name='HostJson'),
  instanceId?: long(name='InstanceId'),
  isTrial?: boolean(name='IsTrial'),
  licenseCode?: string(name='LicenseCode'),
  modules?: [ 
    {
      code?: string(name='Code'),
      id?: string(name='Id'),
      name?: string(name='Name'),
      properties?: [ 
        {
          displayUnit?: string(name='DisplayUnit'),
          key?: string(name='Key'),
          name?: string(name='Name'),
          propertyValues?: [ 
            {
              displayName?: string(name='DisplayName'),
              max?: string(name='Max'),
              min?: string(name='Min'),
              remark?: string(name='Remark'),
              step?: string(name='Step'),
              type?: string(name='Type'),
              value?: string(name='Value'),
            }
          ](name='PropertyValues'),
          showType?: string(name='ShowType'),
        }
      ](name='Properties'),
    }
  ](name='Modules'),
  orderId?: long(name='OrderId'),
  productCode?: string(name='ProductCode'),
  productName?: string(name='ProductName'),
  productSkuCode?: string(name='ProductSkuCode'),
  productType?: string(name='ProductType'),
  relationalData?: {
    serviceStatus?: string(name='ServiceStatus'),
  }(name='RelationalData'),
  requestId?: string(name='RequestId'),
  status?: string(name='Status'),
  supplierName?: string(name='SupplierName'),
}

model DescribeImageInstanceForIsvResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeImageInstanceForIsvResponseBody(name='body'),
}

/**
 * @summary 服务商侧查询镜像实例信息
 *
 * @param request DescribeImageInstanceForIsvRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeImageInstanceForIsvResponse
 */
async function describeImageInstanceForIsvWithOptions(request: DescribeImageInstanceForIsvRequest, runtime: $RuntimeOptions): DescribeImageInstanceForIsvResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.customerPk)) {
    query['CustomerPk'] = request.customerPk;
  }
  if (!$isNull(request.ecsInstanceId)) {
    query['EcsInstanceId'] = request.ecsInstanceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeImageInstanceForIsv',
    version = '2015-11-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 服务商侧查询镜像实例信息
 *
 * @param request DescribeImageInstanceForIsvRequest
 * @return DescribeImageInstanceForIsvResponse
 */
async function describeImageInstanceForIsv(request: DescribeImageInstanceForIsvRequest): DescribeImageInstanceForIsvResponse {
  var runtime = new $RuntimeOptions{};
  return describeImageInstanceForIsvWithOptions(request, runtime);
}

model DescribeInstanceRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='155****11'),
  orderType?: string(name='OrderType', example='NEW'),
  ownerId?: long(name='OwnerId'),
}

model DescribeInstanceResponseBody = {
  activeAddress?: string(name='ActiveAddress'),
  appJson?: string(name='AppJson', example='{"frontEndUrl":"https://****.aliyundoc.com","password":"Sjtv***","adminUrl":"https://****.aliyundoc.com","username":"aliyun***"}'),
  autoRenewal?: string(name='AutoRenewal'),
  beganOn?: long(name='BeganOn', example='1570634021000'),
  componentJson?: string(name='ComponentJson', example='{"package_version":"yuncode000111"}'),
  constraints?: string(name='Constraints', example='{}'),
  createdOn?: long(name='CreatedOn', example='1570634018000'),
  endOn?: long(name='EndOn', example='1602259200000'),
  extendJson?: string(name='ExtendJson'),
  hostJson?: string(name='HostJson', example='{"password":"***","ip":"118.31.***.41","innerIp":"118.31.***.41","region":"","username":"***","beianInfo":""}'),
  instanceId?: long(name='InstanceId', example='1551111111'),
  isTrial?: boolean(name='IsTrial', example='true'),
  licenseCode?: string(name='LicenseCode'),
  modules?: {
    module?: [ 
    {
      code?: string(name='Code', example='package_config'),
      id?: string(name='Id', example='101*********026'),
      name?: string(name='Name'),
      properties?: {
        property?: [ 
        {
          displayUnit?: string(name='DisplayUnit', example='12'),
          key?: string(name='Key', example='12'),
          name?: string(name='Name', example='12'),
          propertyValues?: {
            propertyValue?: [ 
            {
              displayName?: string(name='DisplayName', example='12'),
              max?: string(name='Max', example='12'),
              min?: string(name='Min', example='12'),
              remark?: string(name='Remark', example='12'),
              step?: string(name='Step', example='12'),
              type?: string(name='Type', example='12'),
              value?: string(name='Value', example='12'),
            }
          ](name='PropertyValue')
          }(name='PropertyValues'),
          showType?: string(name='ShowType', example='12'),
        }
      ](name='Property')
      }(name='Properties'),
    }
  ](name='Module')
  }(name='Modules'),
  orderId?: long(name='OrderId', example='204211111111111'),
  productCode?: string(name='ProductCode', example='cmgj00**11'),
  productName?: string(name='ProductName'),
  productSkuCode?: string(name='ProductSkuCode', example='cmgj00**11-prepay'),
  productType?: string(name='ProductType', example='APP'),
  relationalData?: {
    serviceStatus?: string(name='ServiceStatus', example='STARTED'),
  }(name='RelationalData'),
  status?: string(name='Status', example='OPENED'),
  supplierName?: string(name='SupplierName'),
}

model DescribeInstanceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeInstanceResponseBody(name='body'),
}

/**
 * @param request DescribeInstanceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeInstanceResponse
 */
async function describeInstanceWithOptions(request: DescribeInstanceRequest, runtime: $RuntimeOptions): DescribeInstanceResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.orderType)) {
    query['OrderType'] = request.orderType;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeInstance',
    version = '2015-11-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request DescribeInstanceRequest
 * @return DescribeInstanceResponse
 */
async function describeInstance(request: DescribeInstanceRequest): DescribeInstanceResponse {
  var runtime = new $RuntimeOptions{};
  return describeInstanceWithOptions(request, runtime);
}

model DescribeInstanceForIsvRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='155****11'),
}

model DescribeInstanceForIsvResponseBody = {
  activeAddress?: string(name='ActiveAddress'),
  appJson?: string(name='AppJson'),
  autoRenewal?: string(name='AutoRenewal'),
  beganOn?: long(name='BeganOn', example='1570634021000'),
  componentJson?: string(name='ComponentJson', example='{"package_version":"yuncode000111"}'),
  createdOn?: long(name='CreatedOn', example='1570634018000'),
  endOn?: long(name='EndOn', example='1602259200000'),
  extendJson?: string(name='ExtendJson'),
  hostJson?: string(name='HostJson'),
  imageJson?: string(name='ImageJson'),
  instanceId?: long(name='InstanceId', example='1551111111'),
  isTrial?: boolean(name='IsTrial', example='true'),
  licenseCode?: string(name='LicenseCode'),
  orderId?: long(name='OrderId', example='204211111111111'),
  productCode?: string(name='ProductCode', example='cmgj00**11'),
  productName?: string(name='ProductName'),
  productSkuCode?: string(name='ProductSkuCode', example='cmgj00**11-prepay'),
  productType?: string(name='ProductType', example='APP'),
  relationalData?: {
    serviceStatus?: string(name='ServiceStatus', example='STARTED'),
  }(name='RelationalData'),
  requestId?: string(name='RequestId', example='6EF60BEC-****-****-****-270359FB54A7'),
  status?: string(name='Status', example='OPENED'),
  supplierName?: string(name='SupplierName'),
}

model DescribeInstanceForIsvResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeInstanceForIsvResponseBody(name='body'),
}

/**
 * @summary 服务商侧查询实例信息
 *
 * @param request DescribeInstanceForIsvRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeInstanceForIsvResponse
 */
async function describeInstanceForIsvWithOptions(request: DescribeInstanceForIsvRequest, runtime: $RuntimeOptions): DescribeInstanceForIsvResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeInstanceForIsv',
    version = '2015-11-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 服务商侧查询实例信息
 *
 * @param request DescribeInstanceForIsvRequest
 * @return DescribeInstanceForIsvResponse
 */
async function describeInstanceForIsv(request: DescribeInstanceForIsvRequest): DescribeInstanceForIsvResponse {
  var runtime = new $RuntimeOptions{};
  return describeInstanceForIsvWithOptions(request, runtime);
}

model DescribeInstancesRequest {
  codes?: string(name='Codes', example='cmgj000112,cmgj000113'),
  exceptCodes?: string(name='ExceptCodes', example='cmgj000114,cmgj000115'),
  pageNumber?: int32(name='PageNumber', description='This parameter is required.', example='10'),
  pageSize?: int32(name='PageSize', description='This parameter is required.', example='1'),
  productType?: string(name='ProductType', example='1'),
}

model DescribeInstancesResponseBody = {
  instanceItems?: {
    instanceItem?: [ 
    {
      apiJson?: string(name='ApiJson', example='{}'),
      appJson?: string(name='AppJson', example='{"frontEndUrl":"https://***.aliyun.com","password":"Sjtv***","adminUrl":"https://***.aiiyun.com","username":"aliyun***"}'),
      beganOn?: long(name='BeganOn', example='1570634021000'),
      createdOn?: long(name='CreatedOn', example='1570634021000'),
      endOn?: long(name='EndOn', example='1570644021000'),
      extendJson?: string(name='ExtendJson'),
      hostJson?: string(name='HostJson', example='{"password":"***","ip":"118.31.***.41","innerIp":"118.31.***.41","region":"","username":"***","beianInfo":""}'),
      idaasJson?: string(name='IdaasJson', example='{}'),
      imageJson?: string(name='ImageJson', example='{}'),
      instanceId?: long(name='InstanceId', example='1551111111'),
      orderId?: long(name='OrderId', example='204211111111111'),
      productCode?: string(name='ProductCode', example='cmgj00**11'),
      productName?: string(name='ProductName'),
      productSkuCode?: string(name='ProductSkuCode', example='cmgj00**11-prepay'),
      productType?: string(name='ProductType', example='APP'),
      status?: string(name='Status', example='OPENED'),
      supplierName?: string(name='SupplierName'),
    }
  ](name='InstanceItem')
  }(name='InstanceItems'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  requestId?: string(name='RequestId', example='54C22FB9-0CB1-5629-97A8-653FC7990F00'),
  totalCount?: int32(name='TotalCount', example='55'),
}

model DescribeInstancesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeInstancesResponseBody(name='body'),
}

/**
 * @param request DescribeInstancesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeInstancesResponse
 */
async function describeInstancesWithOptions(request: DescribeInstancesRequest, runtime: $RuntimeOptions): DescribeInstancesResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.codes)) {
    query['Codes'] = request.codes;
  }
  if (!$isNull(request.exceptCodes)) {
    query['ExceptCodes'] = request.exceptCodes;
  }
  if (!$isNull(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!$isNull(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!$isNull(request.productType)) {
    query['ProductType'] = request.productType;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeInstances',
    version = '2015-11-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request DescribeInstancesRequest
 * @return DescribeInstancesResponse
 */
async function describeInstances(request: DescribeInstancesRequest): DescribeInstancesResponse {
  var runtime = new $RuntimeOptions{};
  return describeInstancesWithOptions(request, runtime);
}

model DescribeLicenseRequest {
  licenseCode?: string(name='LicenseCode', description='This parameter is required.', example='xxxxxx'),
}

model DescribeLicenseResponseBody = {
  license?: {
    activateTime?: string(name='ActivateTime', example='2019-05-25 09:00:00'),
    createTime?: string(name='CreateTime', example='2019-05-25 09:00:00'),
    expiredTime?: string(name='ExpiredTime', example='2019-06-25 09:00:00'),
    extendArray?: {
      licenseAttribute?: [ 
      {
        code?: string(name='Code', example='-'),
        value?: string(name='Value', example='-'),
      }
    ](name='LicenseAttribute')
    }(name='ExtendArray'),
    extendInfo?: {
      accountQuantity?: long(name='AccountQuantity', example='-'),
      aliUid?: long(name='AliUid', example='190311111111****'),
      email?: string(name='Email', example='id***@**.com'),
      mobile?: string(name='Mobile', example='129****1111'),
    }(name='ExtendInfo'),
    instanceId?: string(name='InstanceId', example='1551111111'),
    licenseCode?: string(name='LicenseCode', example='-'),
    licenseStatus?: string(name='LicenseStatus', example='ACTIVATED'),
    productCode?: string(name='ProductCode', example='cmgj02****'),
    productName?: string(name='ProductName'),
    productSkuId?: string(name='ProductSkuId', example='cmgj02****-prepay'),
    supplierName?: string(name='SupplierName'),
  }(name='License'),
  requestId?: string(name='RequestId', example='6EF60BEC-0242-43AF-BB20-270359FB54A7'),
}

model DescribeLicenseResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeLicenseResponseBody(name='body'),
}

/**
 * @summary 获取License
 *
 * @param request DescribeLicenseRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeLicenseResponse
 */
async function describeLicenseWithOptions(request: DescribeLicenseRequest, runtime: $RuntimeOptions): DescribeLicenseResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.licenseCode)) {
    query['LicenseCode'] = request.licenseCode;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeLicense',
    version = '2015-11-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取License
 *
 * @param request DescribeLicenseRequest
 * @return DescribeLicenseResponse
 */
async function describeLicense(request: DescribeLicenseRequest): DescribeLicenseResponse {
  var runtime = new $RuntimeOptions{};
  return describeLicenseWithOptions(request, runtime);
}

model DescribeOrderRequest {
  orderId?: string(name='OrderId', description='This parameter is required.', example='202*********415'),
}

model DescribeOrderResponseBody = {
  accountQuantity?: long(name='AccountQuantity', example='0'),
  aliUid?: long(name='AliUid', example='190311111111****'),
  components?: map[string]any(name='Components'),
  couponPrice?: float(name='CouponPrice', example='0.0'),
  createdOn?: long(name='CreatedOn', example='1531191564000'),
  instanceIds?: {
    instanceId?: [ string ](name='InstanceId')
  }(name='InstanceIds'),
  orderId?: long(name='OrderId', example='202211111111111'),
  orderStatus?: string(name='OrderStatus', example='NORMAL'),
  orderType?: string(name='OrderType', example='NEW'),
  originalPrice?: float(name='OriginalPrice', example='10.0'),
  paidOn?: long(name='PaidOn', example='1531191675000'),
  payStatus?: string(name='PayStatus', example='PAID'),
  paymentPrice?: float(name='PaymentPrice', example='0.0'),
  periodType?: string(name='PeriodType', example='MONTH'),
  productCode?: string(name='ProductCode', example='cmgj02****'),
  productName?: string(name='ProductName'),
  productSkuCode?: string(name='ProductSkuCode', example='cmgj02****-prepay'),
  quantity?: int32(name='Quantity', example='1'),
  requestId?: string(name='RequestId', example='6EF60BEC-0242-43AF-BB20-270359FB54A7'),
  supplierCompanyName?: string(name='SupplierCompanyName'),
  supplierTelephones?: {
    telephone?: [ string ](name='Telephone')
  }(name='SupplierTelephones'),
  totalPrice?: float(name='TotalPrice', example='0.0'),
}

model DescribeOrderResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeOrderResponseBody(name='body'),
}

/**
 * @param request DescribeOrderRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeOrderResponse
 */
async function describeOrderWithOptions(request: DescribeOrderRequest, runtime: $RuntimeOptions): DescribeOrderResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.orderId)) {
    query['OrderId'] = request.orderId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeOrder',
    version = '2015-11-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request DescribeOrderRequest
 * @return DescribeOrderResponse
 */
async function describeOrder(request: DescribeOrderRequest): DescribeOrderResponse {
  var runtime = new $RuntimeOptions{};
  return describeOrderWithOptions(request, runtime);
}

model DescribeOrderForIsvRequest {
  orderId?: string(name='OrderId', description='This parameter is required.', example='202*********415'),
}

model DescribeOrderForIsvResponseBody = {
  accountQuantity?: long(name='AccountQuantity', example='0'),
  aliUid?: long(name='AliUid', example='190311111111****'),
  components?: any(name='Components'),
  couponPrice?: float(name='CouponPrice', example='0.0'),
  createdOn?: long(name='CreatedOn', example='1531191564000'),
  instanceIds?: [ string ](name='InstanceIds', description='List'),
  orderId?: long(name='OrderId', example='202211111111111'),
  orderStatus?: string(name='OrderStatus', example='NORMAL'),
  orderType?: string(name='OrderType', example='NEW'),
  originalPrice?: float(name='OriginalPrice', example='10.0'),
  paidOn?: long(name='PaidOn', example='1531191675000'),
  payStatus?: string(name='PayStatus', example='PAID'),
  paymentPrice?: float(name='PaymentPrice', example='0.0'),
  periodType?: string(name='PeriodType', example='MONTH'),
  productCode?: string(name='ProductCode', example='cmgj02****'),
  productName?: string(name='ProductName'),
  productSkuCode?: string(name='ProductSkuCode', example='cmgj02****-prepay'),
  quantity?: int32(name='Quantity', example='1'),
  requestId?: string(name='RequestId', example='6EF60BEC-****-****-****-270359FB54A7'),
  totalPrice?: float(name='TotalPrice', example='0.0'),
}

model DescribeOrderForIsvResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeOrderForIsvResponseBody(name='body'),
}

/**
 * @summary 服务商侧查询订单详情
 *
 * @param request DescribeOrderForIsvRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeOrderForIsvResponse
 */
async function describeOrderForIsvWithOptions(request: DescribeOrderForIsvRequest, runtime: $RuntimeOptions): DescribeOrderForIsvResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.orderId)) {
    query['OrderId'] = request.orderId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeOrderForIsv',
    version = '2015-11-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 服务商侧查询订单详情
 *
 * @param request DescribeOrderForIsvRequest
 * @return DescribeOrderForIsvResponse
 */
async function describeOrderForIsv(request: DescribeOrderForIsvRequest): DescribeOrderForIsvResponse {
  var runtime = new $RuntimeOptions{};
  return describeOrderForIsvWithOptions(request, runtime);
}

model DescribePriceRequest {
  commodity?: string(name='Commodity', description='This parameter is required.', example='{"components":{"package_version":"yuncode12928000016"},"duration":1,"pricingCycle":"YEAR","productCode":"cmgj01**28","quantity":1,"skuCode":"prepay"}'),
  orderType?: string(name='OrderType', description='This parameter is required.', example='INSTANCE_BUY'),
}

model DescribePriceResponseBody = {
  coupons?: {
    coupon?: [ 
    {
      canPromFee?: float(name='CanPromFee', example='100.00'),
      couponDesc?: string(name='CouponDesc'),
      couponName?: string(name='CouponName'),
      couponOptionCode?: string(name='CouponOptionCode', example='ActiveCoupon'),
      couponOptionNo?: string(name='CouponOptionNo', example='3874923111'),
      isSelected?: boolean(name='IsSelected', example='false'),
    }
  ](name='Coupon')
  }(name='Coupons'),
  currency?: string(name='Currency', example='CNY'),
  cuxiao?: boolean(name='Cuxiao', example='true'),
  cycle?: string(name='Cycle', example='MONTH'),
  discountPrice?: float(name='DiscountPrice', example='178.20'),
  duration?: int32(name='Duration', example='1'),
  expressionCode?: string(name='ExpressionCode', example='ORDER.NO_REAL_NAME_AUTHENTICATION'),
  expressionMessage?: string(name='ExpressionMessage'),
  infoTitle?: string(name='InfoTitle'),
  originalPrice?: float(name='OriginalPrice', example='198.00'),
  productCode?: string(name='ProductCode', example='cmgj01****'),
  promotionRules?: {
    promotionRule?: [ 
    {
      name?: string(name='Name'),
      ruleId?: string(name='RuleId', example='102112'),
      title?: string(name='Title'),
    }
  ](name='PromotionRule')
  }(name='PromotionRules'),
  tradePrice?: float(name='TradePrice', example='19.80'),
}

model DescribePriceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribePriceResponseBody(name='body'),
}

/**
 * @param request DescribePriceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribePriceResponse
 */
async function describePriceWithOptions(request: DescribePriceRequest, runtime: $RuntimeOptions): DescribePriceResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.commodity)) {
    query['Commodity'] = request.commodity;
  }
  if (!$isNull(request.orderType)) {
    query['OrderType'] = request.orderType;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribePrice',
    version = '2015-11-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request DescribePriceRequest
 * @return DescribePriceResponse
 */
async function describePrice(request: DescribePriceRequest): DescribePriceResponse {
  var runtime = new $RuntimeOptions{};
  return describePriceWithOptions(request, runtime);
}

model DescribeProductRequest {
  aliUid?: string(name='AliUid', description='AliUid', example='190********569'),
  code?: string(name='Code', description='This parameter is required.', example='cmjj01**45'),
  queryDraft?: boolean(name='QueryDraft', example='false'),
}

model DescribeProductResponseBody = {
  auditFailMsg?: string(name='AuditFailMsg'),
  auditStatus?: string(name='AuditStatus', example='function_fail'),
  auditTime?: long(name='AuditTime', example='1581609600000'),
  code?: string(name='Code', example='cmjj01**45'),
  description?: string(name='Description'),
  frontCategoryId?: long(name='FrontCategoryId', example='523617212'),
  gmtCreated?: long(name='GmtCreated', example='1578931200000'),
  gmtModified?: long(name='GmtModified', example='1578931200000'),
  name?: string(name='Name'),
  picUrl?: string(name='PicUrl', example='https://oss.aliyuncs.com/photogallery/photo/1930532890589852/6245/495d5f19-03e4-4c2e-9c4e-bef9ab6af1e1.png'),
  productExtras?: {
    productExtra?: [ 
    {
      key?: string(name='Key', example='product_advantage'),
      label?: string(name='Label'),
      order?: int32(name='Order', example='0'),
      type?: string(name='Type', example='HTML'),
      values?: string(name='Values'),
    }
  ](name='ProductExtra')
  }(name='ProductExtras'),
  productSkus?: {
    productSku?: [ 
    {
      chargeType?: string(name='ChargeType', example='PREPAY'),
      code?: string(name='Code', example='cmjj01****-Package'),
      constraints?: string(name='Constraints', example='{\\\\"img_id\\\\":{\\\\"img_version|img_region\\\\":{\\\\"V1.7|cn-shenzhen-st3-a01\\\\":[\\\\"m-wz9ho4hmos0lpxcldqoq\\\\"]}}'),
      hidden?: boolean(name='Hidden', example='true'),
      modules?: {
        module?: [ 
        {
          code?: string(name='Code', example='img_id'),
          id?: string(name='Id', example='248220'),
          name?: string(name='Name'),
          properties?: {
            property?: [ 
            {
              displayUnit?: string(name='DisplayUnit', example='1'),
              key?: string(name='Key', example='img_id'),
              name?: string(name='Name'),
              propertyValues?: {
                propertyValue?: [ 
                {
                  displayName?: string(name='DisplayName'),
                  max?: string(name='Max', example='123'),
                  min?: string(name='Min', example='11'),
                  remark?: string(name='Remark', example='abc'),
                  step?: string(name='Step', example='1'),
                  type?: string(name='Type', example='single_string'),
                  value?: string(name='Value', example='m-28e213e7t'),
                }
              ](name='PropertyValue')
              }(name='PropertyValues'),
              showType?: string(name='ShowType', example='number'),
            }
          ](name='Property')
          }(name='Properties'),
        }
      ](name='Module')
      }(name='Modules'),
      name?: string(name='Name', example='21'),
      orderPeriods?: {
        orderPeriod?: [ 
        {
          name?: string(name='Name'),
          periodType?: string(name='PeriodType', example='HOUR'),
        }
      ](name='OrderPeriod')
      }(name='OrderPeriods'),
    }
  ](name='ProductSku')
  }(name='ProductSkus'),
  requestId?: string(name='RequestId', example='6EF60BEC-0242-43AF-BB20-270359FB54A7'),
  score?: float(name='Score', example='5.0'),
  shopInfo?: {
    emails?: string(name='Emails', example='46**41@example.com'),
    id?: long(name='Id', example='123'),
    name?: string(name='Name'),
    telephones?: {
      telephone?: [ string ](name='Telephone')
    }(name='Telephones'),
    wangWangs?: {
      wangWang?: [ 
      {
        remark?: string(name='Remark', example='123'),
        userName?: string(name='UserName', example='ABC'),
      }
    ](name='WangWang')
    }(name='WangWangs'),
  }(name='ShopInfo'),
  shortDescription?: string(name='ShortDescription'),
  status?: string(name='Status', example='1'),
  supplierPk?: long(name='SupplierPk', example='1526111111****'),
  type?: string(name='Type', example='MIRROR'),
  useCount?: long(name='UseCount', example='10'),
}

model DescribeProductResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeProductResponseBody(name='body'),
}

/**
 * @param request DescribeProductRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeProductResponse
 */
async function describeProductWithOptions(request: DescribeProductRequest, runtime: $RuntimeOptions): DescribeProductResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.aliUid)) {
    query['AliUid'] = request.aliUid;
  }
  if (!$isNull(request.code)) {
    query['Code'] = request.code;
  }
  if (!$isNull(request.queryDraft)) {
    query['QueryDraft'] = request.queryDraft;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeProduct',
    version = '2015-11-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request DescribeProductRequest
 * @return DescribeProductResponse
 */
async function describeProduct(request: DescribeProductRequest): DescribeProductResponse {
  var runtime = new $RuntimeOptions{};
  return describeProductWithOptions(request, runtime);
}

model DescribeProductsRequest {
  filter?: [ 
    {
      key?: string(name='Key', example='categoryId'),
      value?: string(name='Value', example='53366009'),
    }
  ](name='Filter'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  searchTerm?: string(name='SearchTerm'),
}

model DescribeProductsResponseBody = {
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  productItems?: {
    productItem?: [ 
    {
      categoryId?: long(name='CategoryId', example='53398003'),
      code?: string(name='Code', example='cmjj02****'),
      deliveryDate?: string(name='DeliveryDate'),
      deliveryWay?: string(name='DeliveryWay'),
      imageUrl?: string(name='ImageUrl', example='https://oss.aliyuncs.com/photogallery/photo/1904996544835414/7549/767d6d07-8366-4822-b84e-61f6ea10d146.png'),
      name?: string(name='Name'),
      operationSystem?: string(name='OperationSystem', example='windows'),
      priceInfo?: string(name='PriceInfo', example='{\\\\"DiscountPrice\\\\": 0.0, \\\\"TradePrice\\\\": 15750.0, \\\\"Currency\\\\": \\\\"CNY\\\\", \\\\"OriginalPrice\\\\": 15750.0, \\\\"RuleIds\\\\": {\\\\"RuleId\\\\": []}, \\\\"Coupons\\\\": {\\\\"Coupon\\\\": []}}'),
      score?: string(name='Score', example='5.0'),
      shortDescription?: string(name='ShortDescription'),
      suggestedPrice?: string(name='SuggestedPrice'),
      supplierId?: long(name='SupplierId', example='228399'),
      supplierName?: string(name='SupplierName'),
      tags?: string(name='Tags'),
      targetUrl?: string(name='TargetUrl', example='/products/53616009/cmjj02****.html'),
      warrantyDate?: string(name='WarrantyDate'),
    }
  ](name='ProductItem')
  }(name='ProductItems'),
  requestId?: string(name='RequestId', example='A077D99E-0C4D-421E-A5D4-F533F6657817'),
  totalCount?: int32(name='TotalCount', example='75'),
}

model DescribeProductsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeProductsResponseBody(name='body'),
}

/**
 * @param request DescribeProductsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeProductsResponse
 */
async function describeProductsWithOptions(request: DescribeProductsRequest, runtime: $RuntimeOptions): DescribeProductsResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.filter)) {
    query['Filter'] = request.filter;
  }
  if (!$isNull(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!$isNull(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!$isNull(request.searchTerm)) {
    query['SearchTerm'] = request.searchTerm;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeProducts',
    version = '2015-11-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request DescribeProductsRequest
 * @return DescribeProductsResponse
 */
async function describeProducts(request: DescribeProductsRequest): DescribeProductsResponse {
  var runtime = new $RuntimeOptions{};
  return describeProductsWithOptions(request, runtime);
}

model DescribeProjectAttachmentsRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='4****89'),
}

model DescribeProjectAttachmentsResponseBody = {
  requestId?: string(name='RequestId', example='e03a9f78-7b40-4fb3-a015-350913e37e3f'),
  result?: [ 
    {
      attachmentToken?: string(name='AttachmentToken', example='Mzc4NDAtODQ3MjY4MzI='),
      attachmentType?: string(name='AttachmentType', example='File'),
      content?: string(name='Content'),
      fileLink?: string(name='FileLink', example='http://delivery-center.oss-cn-shanghai.aliyuncs.com/6a8****0e2/e0a***f3.jpg?Expires=1589334682&OSSAccessKeyId=wI2r*********&Signature=JWB39pUxs7RCqrcw58qXPEGu6M0%3D'),
      fileLinkGmtExpired?: long(name='FileLinkGmtExpired', example='1589334682404'),
      fileName?: string(name='FileName', example='f8-test-perview.jpeg'),
      fileSize?: long(name='FileSize', example='109124'),
      fileSuffix?: string(name='FileSuffix', example='jpg'),
      gmtCreate?: long(name='GmtCreate', example='1587968858000'),
      nodeId?: long(name='NodeId', example='8472'),
      nodeName?: string(name='NodeName'),
      operator?: long(name='Operator', example='45261111****'),
      operatorName?: string(name='OperatorName'),
      operatorRole?: string(name='OperatorRole', example='Provider'),
      stepNo?: int32(name='StepNo', example='3'),
    }
  ](name='Result'),
  success?: boolean(name='Success', example='true'),
}

model DescribeProjectAttachmentsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeProjectAttachmentsResponseBody(name='body'),
}

/**
 * @param request DescribeProjectAttachmentsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeProjectAttachmentsResponse
 */
async function describeProjectAttachmentsWithOptions(request: DescribeProjectAttachmentsRequest, runtime: $RuntimeOptions): DescribeProjectAttachmentsResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeProjectAttachments',
    version = '2015-11-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request DescribeProjectAttachmentsRequest
 * @return DescribeProjectAttachmentsResponse
 */
async function describeProjectAttachments(request: DescribeProjectAttachmentsRequest): DescribeProjectAttachmentsResponse {
  var runtime = new $RuntimeOptions{};
  return describeProjectAttachmentsWithOptions(request, runtime);
}

model DescribeProjectInfoRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='4****89'),
}

model DescribeProjectInfoResponseBody = {
  requestId?: string(name='RequestId', example='ee3e1b3b-6c38-4bcf-be40-5a946cfda761'),
  result?: {
    currentStepNo?: int32(name='CurrentStepNo', example='3'),
    customerAliUid?: long(name='CustomerAliUid', example='27291111****'),
    finalStepNo?: int32(name='FinalStepNo', example='4'),
    finishType?: string(name='FinishType', example='null'),
    gmtCreate?: long(name='GmtCreate', example='1588834324000'),
    gmtExpired?: long(name='GmtExpired', example='1620403200000'),
    gmtFinished?: long(name='GmtFinished', example='1620403200000'),
    instanceId?: string(name='InstanceId', example='4****89'),
    orderId?: long(name='OrderId', example='2059111111111'),
    productCode?: string(name='ProductCode', example='cmgj***055'),
    productName?: string(name='ProductName'),
    productSkuCode?: string(name='ProductSkuCode', example='yuncode****500001'),
    productSkuName?: string(name='ProductSkuName'),
    projectStatus?: string(name='ProjectStatus', example='Starting'),
    supplierAliUid?: long(name='SupplierAliUid', example='45121111****'),
    templateId?: long(name='TemplateId', example='410'),
    templateType?: string(name='TemplateType', example='Public'),
  }(name='Result'),
  success?: boolean(name='Success', example='true'),
}

model DescribeProjectInfoResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeProjectInfoResponseBody(name='body'),
}

/**
 * @param request DescribeProjectInfoRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeProjectInfoResponse
 */
async function describeProjectInfoWithOptions(request: DescribeProjectInfoRequest, runtime: $RuntimeOptions): DescribeProjectInfoResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeProjectInfo',
    version = '2015-11-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request DescribeProjectInfoRequest
 * @return DescribeProjectInfoResponse
 */
async function describeProjectInfo(request: DescribeProjectInfoRequest): DescribeProjectInfoResponse {
  var runtime = new $RuntimeOptions{};
  return describeProjectInfoWithOptions(request, runtime);
}

model DescribeProjectMessagesRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='4****89'),
  pageIndex?: int32(name='PageIndex', example='1'),
}

model DescribeProjectMessagesResponseBody = {
  requestId?: string(name='RequestId', example='00eb4de1-6cff-4f56-833e-7b1e070e398d'),
  result?: [ 
    {
      content?: string(name='Content'),
      gmtCreate?: long(name='GmtCreate', example='1589015560000'),
      operator?: long(name='Operator', example='452611111****'),
      operatorName?: string(name='OperatorName'),
      operatorRole?: string(name='OperatorRole', example='Provider'),
    }
  ](name='Result'),
  success?: boolean(name='Success', example='true'),
  totalCount?: long(name='TotalCount', example='28'),
}

model DescribeProjectMessagesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeProjectMessagesResponseBody(name='body'),
}

/**
 * @param request DescribeProjectMessagesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeProjectMessagesResponse
 */
async function describeProjectMessagesWithOptions(request: DescribeProjectMessagesRequest, runtime: $RuntimeOptions): DescribeProjectMessagesResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.pageIndex)) {
    query['PageIndex'] = request.pageIndex;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeProjectMessages',
    version = '2015-11-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request DescribeProjectMessagesRequest
 * @return DescribeProjectMessagesResponse
 */
async function describeProjectMessages(request: DescribeProjectMessagesRequest): DescribeProjectMessagesResponse {
  var runtime = new $RuntimeOptions{};
  return describeProjectMessagesWithOptions(request, runtime);
}

model DescribeProjectNodesRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='4****89'),
}

model DescribeProjectNodesResponseBody = {
  requestId?: string(name='RequestId', example='937fee1f-26bb-4b6e-8def-977a6bdaa1e5'),
  result?: [ 
    {
      allowRollbackNode?: boolean(name='AllowRollbackNode', example='false'),
      autoFinishNode?: boolean(name='AutoFinishNode', example='false'),
      finalStepNo?: int32(name='FinalStepNo', example='4'),
      gmtExpired?: long(name='GmtExpired', example='1588834325000'),
      gmtFinished?: long(name='GmtFinished', example='1588834325000'),
      gmtStart?: long(name='GmtStart', example='1588834325000'),
      needAttachment?: boolean(name='NeedAttachment', example='false'),
      nextNodeId?: long(name='NextNodeId', example='8472'),
      nodeId?: long(name='NodeId', example='8471'),
      nodeName?: string(name='NodeName'),
      nodeStatus?: string(name='NodeStatus', example='Finish'),
      operatorRole?: string(name='OperatorRole', example='System'),
      parentNodeId?: long(name='ParentNodeId', example='0'),
      previousNodeId?: long(name='PreviousNodeId', example='8470'),
      stepNo?: int32(name='StepNo', example='2'),
      templateForm?: string(name='TemplateForm'),
    }
  ](name='Result'),
  success?: boolean(name='Success', example='true'),
}

model DescribeProjectNodesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeProjectNodesResponseBody(name='body'),
}

/**
 * @description **
 * **
 *
 * @param request DescribeProjectNodesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeProjectNodesResponse
 */
async function describeProjectNodesWithOptions(request: DescribeProjectNodesRequest, runtime: $RuntimeOptions): DescribeProjectNodesResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeProjectNodes',
    version = '2015-11-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @description **
 * **
 *
 * @param request DescribeProjectNodesRequest
 * @return DescribeProjectNodesResponse
 */
async function describeProjectNodes(request: DescribeProjectNodesRequest): DescribeProjectNodesResponse {
  var runtime = new $RuntimeOptions{};
  return describeProjectNodesWithOptions(request, runtime);
}

model DescribeProjectOperateLogsRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='4****89'),
}

model DescribeProjectOperateLogsResponseBody = {
  requestId?: string(name='RequestId', example='e6037e86-657f-4194-bb6a-7b26973aec8d'),
  result?: [ 
    {
      description?: string(name='Description'),
      gmtCreate?: long(name='GmtCreate', example='1587624497000'),
      operator?: long(name='Operator', example='0'),
      operatorName?: string(name='OperatorName'),
      operatorRole?: string(name='OperatorRole', example='System'),
    }
  ](name='Result'),
  success?: boolean(name='Success', example='true'),
}

model DescribeProjectOperateLogsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeProjectOperateLogsResponseBody(name='body'),
}

/**
 * @param request DescribeProjectOperateLogsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeProjectOperateLogsResponse
 */
async function describeProjectOperateLogsWithOptions(request: DescribeProjectOperateLogsRequest, runtime: $RuntimeOptions): DescribeProjectOperateLogsResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeProjectOperateLogs',
    version = '2015-11-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request DescribeProjectOperateLogsRequest
 * @return DescribeProjectOperateLogsResponse
 */
async function describeProjectOperateLogs(request: DescribeProjectOperateLogsRequest): DescribeProjectOperateLogsResponse {
  var runtime = new $RuntimeOptions{};
  return describeProjectOperateLogsWithOptions(request, runtime);
}

model FinishCurrentProjectNodeRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='4****89'),
  nodeId?: long(name='NodeId', description='This parameter is required.', example='1924'),
  remark?: string(name='Remark'),
  templateForm?: string(name='TemplateForm'),
}

model FinishCurrentProjectNodeResponseBody = {
  requestId?: string(name='RequestId', example='ee69a00f-189b-400f-9fd2-af89749fb50f'),
  result?: boolean(name='Result', example='true'),
  success?: boolean(name='Success', example='true'),
}

model FinishCurrentProjectNodeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: FinishCurrentProjectNodeResponseBody(name='body'),
}

/**
 * @param request FinishCurrentProjectNodeRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return FinishCurrentProjectNodeResponse
 */
async function finishCurrentProjectNodeWithOptions(request: FinishCurrentProjectNodeRequest, runtime: $RuntimeOptions): FinishCurrentProjectNodeResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.nodeId)) {
    query['NodeId'] = request.nodeId;
  }
  if (!$isNull(request.remark)) {
    query['Remark'] = request.remark;
  }
  if (!$isNull(request.templateForm)) {
    query['TemplateForm'] = request.templateForm;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'FinishCurrentProjectNode',
    version = '2015-11-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request FinishCurrentProjectNodeRequest
 * @return FinishCurrentProjectNodeResponse
 */
async function finishCurrentProjectNode(request: FinishCurrentProjectNodeRequest): FinishCurrentProjectNodeResponse {
  var runtime = new $RuntimeOptions{};
  return finishCurrentProjectNodeWithOptions(request, runtime);
}

model PauseProjectRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='4****89'),
  nodeId?: long(name='NodeId', description='This parameter is required.', example='1922'),
  remark?: string(name='Remark'),
}

model PauseProjectResponseBody = {
  requestId?: string(name='RequestId', example='ee69a00f-189b-400f-9fd2-af89749fb50f'),
  result?: boolean(name='Result', example='true'),
  success?: boolean(name='Success', example='true'),
}

model PauseProjectResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: PauseProjectResponseBody(name='body'),
}

/**
 * @param request PauseProjectRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return PauseProjectResponse
 */
async function pauseProjectWithOptions(request: PauseProjectRequest, runtime: $RuntimeOptions): PauseProjectResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.nodeId)) {
    query['NodeId'] = request.nodeId;
  }
  if (!$isNull(request.remark)) {
    query['Remark'] = request.remark;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'PauseProject',
    version = '2015-11-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request PauseProjectRequest
 * @return PauseProjectResponse
 */
async function pauseProject(request: PauseProjectRequest): PauseProjectResponse {
  var runtime = new $RuntimeOptions{};
  return pauseProjectWithOptions(request, runtime);
}

model PushMeteringDataRequest {
  metering?: string(name='Metering', example='[{"InstanceId":"1000001","StartTime":"100000000","EndTime":"100000010","Entities":[{"Key":"PeriodMin","Value":"96","meteringAssit":"cmapi00060317-PeriodMin-4"}]}]'),
}

model PushMeteringDataResponseBody = {
  requestId?: string(name='RequestId', example='6EF60BEC-0242-43AF-BB20-270359FB54A7'),
  success?: boolean(name='Success', example='true'),
}

model PushMeteringDataResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: PushMeteringDataResponseBody(name='body'),
}

/**
 * @param request PushMeteringDataRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return PushMeteringDataResponse
 */
async function pushMeteringDataWithOptions(request: PushMeteringDataRequest, runtime: $RuntimeOptions): PushMeteringDataResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.metering)) {
    query['Metering'] = request.metering;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'PushMeteringData',
    version = '2015-11-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request PushMeteringDataRequest
 * @return PushMeteringDataResponse
 */
async function pushMeteringData(request: PushMeteringDataRequest): PushMeteringDataResponse {
  var runtime = new $RuntimeOptions{};
  return pushMeteringDataWithOptions(request, runtime);
}

model ResumeProjectRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='4****89'),
  nodeId?: long(name='NodeId', description='This parameter is required.', example='1922'),
  remark?: string(name='Remark'),
}

model ResumeProjectResponseBody = {
  requestId?: string(name='RequestId', example='ee69a00f-189b-400f-9fd2-af89749fb50f'),
  result?: boolean(name='Result', example='true'),
  success?: boolean(name='Success', example='true'),
}

model ResumeProjectResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ResumeProjectResponseBody(name='body'),
}

/**
 * @param request ResumeProjectRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ResumeProjectResponse
 */
async function resumeProjectWithOptions(request: ResumeProjectRequest, runtime: $RuntimeOptions): ResumeProjectResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.nodeId)) {
    query['NodeId'] = request.nodeId;
  }
  if (!$isNull(request.remark)) {
    query['Remark'] = request.remark;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ResumeProject',
    version = '2015-11-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request ResumeProjectRequest
 * @return ResumeProjectResponse
 */
async function resumeProject(request: ResumeProjectRequest): ResumeProjectResponse {
  var runtime = new $RuntimeOptions{};
  return resumeProjectWithOptions(request, runtime);
}

model RollbackCurrentProjectNodeRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='4****89'),
  nodeId?: long(name='NodeId', description='This parameter is required.', example='1925'),
  remark?: string(name='Remark'),
}

model RollbackCurrentProjectNodeResponseBody = {
  requestId?: string(name='RequestId', example='ee69a00f-189b-400f-9fd2-af89749fb50f'),
  result?: boolean(name='Result', example='true'),
  success?: boolean(name='Success', example='true'),
}

model RollbackCurrentProjectNodeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RollbackCurrentProjectNodeResponseBody(name='body'),
}

/**
 * @param request RollbackCurrentProjectNodeRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return RollbackCurrentProjectNodeResponse
 */
async function rollbackCurrentProjectNodeWithOptions(request: RollbackCurrentProjectNodeRequest, runtime: $RuntimeOptions): RollbackCurrentProjectNodeResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.nodeId)) {
    query['NodeId'] = request.nodeId;
  }
  if (!$isNull(request.remark)) {
    query['Remark'] = request.remark;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'RollbackCurrentProjectNode',
    version = '2015-11-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request RollbackCurrentProjectNodeRequest
 * @return RollbackCurrentProjectNodeResponse
 */
async function rollbackCurrentProjectNode(request: RollbackCurrentProjectNodeRequest): RollbackCurrentProjectNodeResponse {
  var runtime = new $RuntimeOptions{};
  return rollbackCurrentProjectNodeWithOptions(request, runtime);
}

